package com.lft01.thread;

/**
 * Function: 		ADD FUNCTION.
 * Reason:   		ADD REASON.
 * Date             2020/6/6 14:32
 * <p>
 * Class Name:      RestaurantTest
 * Package Name:    com.lft.thread
 *
 * @author Laifengting
 * @version 1.0.0
 * @since JDK 8
 */
public class RestaurantTest {
	public static void main(String[] args) {
		System.out.println("餐馆开张了");
		Restaurant restaurant = new Restaurant();
		
		new Thread(() -> {
			for (int i = 1; i <= 5; i++) {
				restaurant.cut();
			}
		}, "切菜师傅").start();
		
		new Thread(() -> {
			for (int i = 1; i <= 5; i++) {
				restaurant.cook();
			}
		}, "烧菜师傅").start();
		
		new Thread(() -> {
			for (int i = 1; i <= 5; i++) {
				restaurant.giving();
				System.out.println("**********第" + i + "道菜已经完成**********");
			}
		}, "送菜师傅").start();
		
	}
}
